<?
//Place 0.0.2
class sym_place extends symbiont{
    private $places=array();
    private $i=0;
    public $link;
    public function __construct(){
        global $kernel;
        $this->link=$kernel->site->url.($kernel->site->mlm=='true'?$kernel->lang->abbr.'/':'');
        array_push($this->places, array('title'=>$kernel->page->title, 'link'=>$kernel->page->name));
    }
    public function ___main($design='', $new=false){
        global $kernel;
        $design=$this->_check($design, 'main');
        $d=new design($design, 'place', false);
        $this->items='';
        $l=count($this->places);
        if($new===false||$new==='false'||$new===0){
            $this->i=0;
            $this->link=$kernel->site->url.($kernel->site->mlm=='true'?$kernel->lang->abbr.'/':'');
            $this->new=false;
        }
        else{
            $this->new=true;
        }
        for($i=$this->i; $i<$l; $i++){
            $place=$this->places[$i];
            $this->title=$place['title'];
            $this->link.=$place['link'].'/';
            $this->items.=($this->i?$this->separator:'').design::run($this->item);
            $this->i++;
        }
        $d->inc();
    }
    public function add($title, $link=''){
        array_push($this->places, array('title'=>$title, 'link'=>$link));
        $this->___main('', true);
    }
}
?>